/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exatrez.stripes.util;

import com.google.inject.Inject;
import exatrez.dao.ShipVisitComplianceDAO;
import exatrez.dao.ShipVisitHeaderDAO;
import exatrez.model.ShipVisitCompliance;
import exatrez.model.ShipVisitDescription;
import exatrez.model.ShipVisitHeader;
import exatrez.stripes.BaseActionBean;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author Mansur
 */
public class ShipVisitListUtil extends BaseActionBean{
    
    private static Logger LOG = LoggerFactory.getLogger(ShipVisitListUtil.class);
    
    @Inject
    protected com.google.inject.Provider<Session> sessionProvider;
    @Inject
    ShipVisitComplianceDAO shipVisitComplianceDAO;
    @Inject
    ShipVisitHeaderDAO shipVisitHeaderDAO;
    
    public List<ShipVisitCompliance> getListCompliance(){
        return shipVisitComplianceDAO.findAll();
    }
    
    public List<ShipVisitDescription> getListDesc1(){
        String query = "SELECT a FROM ShipVisitDescription a WHERE a.svHeaderId.svHeaderId = '1' order by a.sortNumber asc ";
        Query q = sessionProvider.get().createQuery(query);
        return q.list();
    }
    
    public List<ShipVisitDescription> getListDesc2(){
        String query = "SELECT a FROM ShipVisitDescription a WHERE a.svHeaderId.svHeaderId = '2' order by a.sortNumber asc ";
        Query q = sessionProvider.get().createQuery(query);
        return q.list();
    }
    
    public List<ShipVisitDescription> getListDesc3(){
        String query = "SELECT a FROM ShipVisitDescription a WHERE a.svHeaderId.svHeaderId = '3' order by a.sortNumber asc ";
        Query q = sessionProvider.get().createQuery(query);
        return q.list();
    }
    
    public List<ShipVisitDescription> getListDesc4(){
        String query = "SELECT a FROM ShipVisitDescription a WHERE a.svHeaderId.svHeaderId = '4' order by a.sortNumber asc ";
        Query q = sessionProvider.get().createQuery(query);
        return q.list();
    }
    
    public List<ShipVisitDescription> getListDesc5(){
        String query = "SELECT a FROM ShipVisitDescription a WHERE a.svHeaderId.svHeaderId = '5' order by a.sortNumber asc ";
        Query q = sessionProvider.get().createQuery(query);
        return q.list();
    }
    
    public List<ShipVisitDescription> getListDesc6(){
        String query = "SELECT a FROM ShipVisitDescription a WHERE a.svHeaderId.svHeaderId = '6' order by a.sortNumber asc ";
        Query q = sessionProvider.get().createQuery(query);
        return q.list();
    }
    
    public List<ShipVisitDescription> getListDesc7(){
        String query = "SELECT a FROM ShipVisitDescription a WHERE a.svHeaderId.svHeaderId = '7' order by a.sortNumber asc ";
        Query q = sessionProvider.get().createQuery(query);
        return q.list();
    }
    
    public List<ShipVisitDescription> getListDesc8(){
        String query = "SELECT a FROM ShipVisitDescription a WHERE a.svHeaderId.svHeaderId = '8' order by a.sortNumber asc ";
        Query q = sessionProvider.get().createQuery(query);
        return q.list();
    }
    
    public List<ShipVisitDescription> getListDesc9(){
        String query = "SELECT a FROM ShipVisitDescription a WHERE a.svHeaderId.svHeaderId = '9' order by a.sortNumber asc ";
        Query q = sessionProvider.get().createQuery(query);
        return q.list();
    }
    
    public List<ShipVisitDescription> getListDesc10(){
        String query = "SELECT a FROM ShipVisitDescription a WHERE a.svHeaderId.svHeaderId = '10' order by a.sortNumber asc ";
        Query q = sessionProvider.get().createQuery(query);
        return q.list();
    }
    
    public List<ShipVisitDescription> getListDesc11(){
        String query = "SELECT a FROM ShipVisitDescription a WHERE a.svHeaderId.svHeaderId = '11' order by a.sortNumber asc ";
        Query q = sessionProvider.get().createQuery(query);
        return q.list();
    }
    
    public List<ShipVisitDescription> getListDesc12(){
        String query = "SELECT a FROM ShipVisitDescription a WHERE a.svHeaderId.svHeaderId = '12' order by a.sortNumber asc ";
        Query q = sessionProvider.get().createQuery(query);
        return q.list();
    }
    
    public List<ShipVisitDescription> getListDesc13(){
        String query = "SELECT a FROM ShipVisitDescription a WHERE a.svHeaderId.svHeaderId = '13' order by a.sortNumber asc ";
        Query q = sessionProvider.get().createQuery(query);
        return q.list();
    }
    
    public List<ShipVisitDescription> getListDesc14(){
        String query = "SELECT a FROM ShipVisitDescription a WHERE a.svHeaderId.svHeaderId = '14' order by a.sortNumber asc ";
        Query q = sessionProvider.get().createQuery(query);
        return q.list();
    }
    
    public String getHeader1(){
        return shipVisitHeaderDAO.findById("1").getDescription();
    }
    
    public String getHeader2(){
        return shipVisitHeaderDAO.findById("2").getDescription();
    }
    
    public String getHeader3(){
        return shipVisitHeaderDAO.findById("3").getDescription();
    }
    
    public String getHeader4(){
        return shipVisitHeaderDAO.findById("4").getDescription();
    }
    
    public String getHeader5(){
        return shipVisitHeaderDAO.findById("5").getDescription();
    }
    
    public String getHeader6(){
        return shipVisitHeaderDAO.findById("6").getDescription();
    }
    
    public String getHeader7(){
        return shipVisitHeaderDAO.findById("7").getDescription();
    }
    
    public String getHeader8(){
        return shipVisitHeaderDAO.findById("8").getDescription();
    }
    
    public String getHeader9(){
        return shipVisitHeaderDAO.findById("9").getDescription();
    }
    
    public String getHeader10(){
        return shipVisitHeaderDAO.findById("10").getDescription();
    }
    
    public String getHeader11(){
        return shipVisitHeaderDAO.findById("11").getDescription();
    }
    
    public String getHeader12(){
        return shipVisitHeaderDAO.findById("12").getDescription();
    }
    
    public String getHeader13(){
        return shipVisitHeaderDAO.findById("13").getDescription();
    }
    
    public String getHeader14(){
        return shipVisitHeaderDAO.findById("14").getDescription();
    }
    
    public String getHeader15(){
        return shipVisitHeaderDAO.findById("15").getDescription();
    }
    
    public List<ShipVisitHeader> getListHeader(){
        return shipVisitHeaderDAO.findAll();
    }
}
